package com.iplant.basic.service;

import com.iplant.base.po.*;
import com.iplant.base.po.excel.ExcelData;
import com.iplant.basic.service.po.bfc.BFCHandleTaskMessage;
import com.iplant.basic.service.po.bfc.BFCHomePageGroup;
import com.iplant.basic.service.po.bfc.BFCHomePageModule;
import com.iplant.basic.service.po.bfc.BFCMessage;
import com.iplant.basic.service.po.bms.BMSEmployee;
import com.iplant.basic.service.po.update.AppUpdateInfo;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

public interface BFCService {


    BPMResource<BFCHandleTaskMessage> mBFCHandleTaskMessageResource = new BPMResource<>();

    ServiceResult<List<BFCHomePageGroup>> BFC_GetHomePageGroupList(BMSEmployee wLoginUser, String wProjectName,
                                                                   Integer wType,
                                                                   Integer wActive, String wName,
                                                                   Pagination wPagination);

    ServiceResult<Integer> BFC_UpdateHomePageGroup(BMSEmployee wLoginUser, BFCHomePageGroup wBFCHomePageGroup);

    ServiceResult<List<BFCHomePageModule>> BFC_GetHomePageModuleList(BMSEmployee wLoginUser, String wProjectName,
                                                                     Integer wType,
                                                                     int wUserEnable, int wAdminEnable,int wEngineerEnable,int wSystemEnable,  Integer wActive, String wName,
                                                                     int wGroupID, Pagination wPagination);

    ServiceResult<BFCHomePageModule> BFC_GetHomePageModuleByID(BMSEmployee wLoginUser, Integer wID);

    ServiceResult<Integer> BFC_UpdateHomePageModule(BMSEmployee wLoginUser, BFCHomePageModule wBFCHomePageModule);

    ServiceResult<List<BFCMessage>> BFC_GetMessageList(BMSEmployee wLoginUser, Integer wResponsorID, Integer wType,
                                                       List<Integer> wModuleID, List<Integer> wMessageIDList,
                                                       List<Integer> wActive, Integer wSendStatus,
                                                       Integer wShiftID, Calendar wStartTime, Calendar wEndTime,
                                                       Integer wStepID, Pagination wPagination);

    ServiceResult<Integer> BFC_GetMessageCount(BMSEmployee wLoginUser, Integer wResponsorID, Integer wType,
                                               List<Integer> wModuleID);

    ServiceResult<List<BFCMessage>> BFC_GetUndoMessageList(BMSEmployee wLoginUser, Integer wResponsorID,
                                                           List<Integer> wModuleID, Integer wMessageID,
                                                           Integer wShiftID, Calendar wStartTime, Calendar wEndTime,
                                                           Pagination wPagination);

    ServiceResult<Integer> BFC_UpdateMessageList(BMSEmployee wLoginUser, List<BFCMessage> wBFCMessageList);

    ServiceResult<Integer> BFC_HandleMessageByIDList(BMSEmployee wLoginUser, List<Integer> wMsgIDList, Integer wStatus,
                                                     Integer wSendStatus,Calendar wMin,Calendar wMax);

    ServiceResult<Integer> BFC_ReceiveMessage(BMSEmployee wLoginUser, Integer wResponsorID, List<Integer> wMsgIDList,
                                              List<Integer> wStepID, Integer wModuleID,Calendar wMin,Calendar wMax);

    ServiceResult<Integer> BFC_HandleMessage(BMSEmployee wLoginUser, Integer wResponsorID, List<Integer> wMsgIDList,
                                             List<Integer> wStepID, Integer wModuleID, Integer wType, Integer wStatus,Calendar wMin,Calendar wMax);

    ServiceResult<Integer> BFC_ForwardMessage(BMSEmployee wLoginUser, Integer wResponsorID,
                                              List<Integer> wForwarderList, Integer wModuleID, Integer wMessageID,
                                              Integer wStepID);

    ServiceResult<Integer> BFC_HandleTaskMessage(BMSEmployee wLoginUser, Integer wResponsorID,
                                                 List<Integer> wTaskIDList, Integer wModuleID, Integer wStepID,
                                                 Integer wStatus, Integer wAuto,Calendar wMin,Calendar wMax);

    /**
     * 修改发送状态
     *
     * @param wBFCMessageList
     * @return
     */
    ServiceResult<Integer> BFC_SendMessageList(BMSEmployee wLoginUser, List<BFCMessage> wBFCMessageList,
                                               int wSendStatus);

    /**
     * 获取模块代办消息数
     *
     * @param wResponsorID
     * @param wShiftID
     * @return
     */
    ServiceResult<Map<Integer, Integer>> BFC_GetUndoMessagCount(BMSEmployee wLoginUser, Integer wResponsorID,
                                                                Integer wShiftID);

    /**
     * 获取模块代办通知消息集合
     *
     * @param wResponsorID
     * @return
     */
    ServiceResult<List<BFCMessage>> BFC_GetNoticeList(BMSEmployee wLoginUser, Integer wResponsorID,
                                                      List<Integer> wModuleID, Integer wStatus, Integer wUseTime,
                                                      Calendar wStartTime, Calendar wEndTime,
                                                      OutResult<Integer> wCount, Pagination wPagination);

    /**
     * 已办消息数
     *
     * @param wResponsorID
     * @param wStartTime
     * @param wEndTime
     * @return
     */
    ServiceResult<List<BFCMessage>> BFC_GetMessageDoneList(BMSEmployee wLoginUser, Integer wResponsorID,
                                                           List<Integer> wModuleID, Calendar wStartTime,
                                                           Calendar wEndTime, Pagination wPagination);

    // 错误日志
    ServiceResult<List<ErrorLogItem>> BFC_QueryLogFileList(BMSEmployee wLoginUser);

    ServiceResult<List<String>> BFC_SelectLogFile(BMSEmployee wLoginUser, String wFilePath);

    ServiceResult<Boolean> BFC_DeleteLogFile(BMSEmployee wLoginUser, String wFilePath);

    ServiceResult<String> BFC_DeleteLogFileList(BMSEmployee wLoginUser, List<String> wFilePathList);

    ServiceResult<List<? extends BasePO>> BFC_GetTaskList(
            BMSEmployee wLoginUser, int wTag, String wIndexName, int wResponsorID, List<Integer> wEventIDs,
            Calendar wStartTime, Calendar wEndTime, Pagination wPagination);

    ServiceResult<BasePO> BFC_GetTaskInfo(
            BMSEmployee wLoginUser, String wIndexName, int wID, String wCode);

    ServiceResult<List<? extends BasePO>> BFC_UpdateTaskList(
            BMSEmployee wLoginUser, String wIndexName, List<Map> wTList, Integer wModuleID,
            Integer wStepID, int wStatus,Calendar wMin,Calendar wMax);

    //region 错误日志
    ServiceResult<Integer> ELG_EmptyFile(BMSEmployee wLoginUser, String wFilePath);

    //endregion

    //region app更新
    ServiceResult<AppUpdateInfo> APP_QueryUpdateInfo(BMSEmployee wLoginUser);

    //endregion

    //region 消息推送
    ServiceResult<Integer> BFC_WebSocketMessageSend(BMSEmployee wLoginUser, List<BFCMessage> wBFCMessageList);

    ServiceResult<Integer> BFC_AutoWSSendMessage(BMSEmployee sysAdmin);

    ServiceResult<Integer> BFC_SendMessageByID(BMSEmployee wLoginUser, int wMessaegID);
    //endregion

//    ServiceResult<Integer> BFC_CopyMenuItem(BMSEmployee wLoginUser, int wMenuItemID, int wTargetGrad, int wTargetGroupID);

    ServiceResult<String> BFC_ImortPo(BMSEmployee wLoginUser, ExcelData wExcelData);
}
